import request from '../utils/request'

const api_name = '/admin/hosp/hospitalSet'

export default {
  getHospList(currentPage, limit, searchObj) {
    return request({
      url: `${api_name}/list/${currentPage}/${limit}`,
      method: 'post',
      data: searchObj
    })
  },
  indexHospList(currentPage, limit) {
    return request({
      url: `${api_name}/list/${currentPage}/${limit}`,
      method: 'get'
    })
  },
  removeDataById(id) {
    return request({
      url: `${api_name}/deleteByid/${id}`,
      method: 'delete'
    })
  },

  batchRemove(idList) {
    return request({
      url: `${api_name}/batchRemove`,
      method: 'delete',
      data: idList
    })
  },

  // 锁定和取消锁定
  lockHospSet(id, status) {
    return request({
      url: `${api_name}/lockHospitalSet/${id}/${status}`,
      method: 'get'
    })
  },

  saveHospitalSet(hospitalSet) {
    return request({
      url: `/admin/hosp/hospitalSet/saveHospitalSet`,
      method: 'post',
      data: hospitalSet
    })
  },

  // 医院设置id查询, 用于查询医院进行编辑回显
  getHospitalSetById(id) {
    return request({
      url: `${api_name}/getHospSet/${id}`,
      method: 'get'
    })
  },

  // 根据hospitalSet更新数据
  updateHospitalSet(hospitalSet) {
    return request({
      url: `${api_name}/updateHospitalSet`,
      method: 'post',
      data: hospitalSet
    })
  }

}
